<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.*"%>
<!DOCTYPE html >
<html>
<head><script type="text/javascript">
	function isSuccessful(form){
		
		if(form.username=""){
			alert("用户名不能为空");
			return false;
		}

	if(form.pwd.value!=form.pwd2.value){
		alert("两次密码输入不同！");
		return false;
	}
	else if(form.pwd.value==""){
		alert("密码不能为空 ");
		return false;
	}
	else return true;
	}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
</head>
<body>
	<h2>用户注册</h2>
	<form action="checkpage1.jsp" method="post" onSubmit="isSuccessful(this)">
	<table>
		<tr>
			<td>用户名</td>
			<td><input type="text" name="username" placeholder="请输入用户名" size="20"></td>
		</tr>
		<tr>
			<td>密码</td>
			<td><input type="password" name="pwd" placeholder="请输入密码" size="20"></td>
		</tr>
		<tr>
			<td>重复密码</td>
			<td><input type="password" name="pwd2" placeholder="请输入密码" size="20"></td>
		</tr>
		<tr>
			<td><input type="reset" value="重置"></td>
			<td><input type="submit" value="注册"></td>
 		</tr>
	</table>
	</form>
</body>
</html>